<T:ViewBase x:Class="WPFExcelReport.TPVA09"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
                    xmlns:VA="clr-namespace:WPFExcelReport;assembly=TVAART" 
                    xmlns:WF="clr-namespace:WPFExcelReport;assembly=TWAFARBEN" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    Background="White"  
                    Name="TV"
                    Loaded="Window_Loaded"
     >
    <T:ViewBase.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/> 
        <ucd:Divideby1000  x:Key="d1000"/> 
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>  
    </T:ViewBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0"> 
           <WrapPanel Background="{StaticResource QueryZoneBrush}">
                    <Button  Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="1" >查询</TextBlock>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=季节:}}"></TextBlock>
                        <VAK:TSVA02 Grid.Row="1"  KOLL="{Binding KOLL }" /> 
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=品种:}}"></TextBlock>
                        <ex:AutoTrimTextBox MaxLength="24" Grid.Row="1"  Text="{Binding ART }" Width="80" />
                    </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=色号:}}"></TextBlock>
                    <ex:AutoTrimTextBox MaxLength="24" Grid.Row="1"  Text="{Binding FARBE }" Width="80" />
                </Grid> 
                <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=色名:}}"></TextBlock>
                        <ex:AutoTrimTextBox  Grid.Row="1"  Text="{Binding DES,Converter={StaticResource ResourceKey=gb2312} }" Width="80" />
                    </Grid> 
                </WrapPanel> 
        </StackPanel>
        <Border Grid.Row="1" BorderThickness="2,2,0,0" BorderBrush="{StaticResource BorderBrush}">
            <Grid >
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                </Grid.RowDefinitions>
                <StackPanel IsEnabled="{Binding IsEditor}">
                    <WrapPanel Visibility="{Binding IsEditor, Converter={StaticResource ResourceKey=bv}}" >
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button   Click="NewCommand" Height="20" Margin="5,0,0,0" Width="20" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/New.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock Grid.Column="1" >新建</TextBlock>
                        </Grid>
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button   Click="EditCommand" Height="20" Margin="5,0,0,0" Width="20" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock Grid.Column="1" >编辑</TextBlock>
                        </Grid>
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="20" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Delete.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock Grid.Column="1" >删除</TextBlock>
                        </Grid>
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button    Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="20" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock Grid.Column="1" >复制</TextBlock>
                        </Grid>
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button   Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="20" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                                </Button.Background>
                            </Button>
                            <Image Grid.Column="1" Source="/ImagePackage;component/Images/star.png" Visibility="{Binding IsChangedExt,ElementName=TV,Converter={StaticResource ResourceKey=bv}}"/>
                            <TextBlock Grid.Column="2" >保存</TextBlock>
                        </Grid>
                        <WrapPanel IsEnabled="{Binding IsKEY,ElementName=TV,Converter={StaticResource ResourceKey=bv}}">
                           
                            <Grid Margin="10,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=色号:}}"></TextBlock>
                                <ex:TXT72 Grid.Column="1" TabIndex="601"  MaxLength="24"  CharacterCasing="Upper"  Text="{Binding VAFFARBE,Source={StaticResource ResourceKey=vwMaster},Converter={StaticResource ResourceKey=gb2312}}"  Width="160" />
                            </Grid>
                        </WrapPanel>
                    </WrapPanel>
                    <StackPanel  IsEnabled="{Binding IsEdit,ElementName=TV}">  
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=色名:}}"></TextBlock>
                            <ex:TXT72 MaxLength="20"  CharacterCasing="Upper"  Text="{Binding VAFBEZ,Source={StaticResource ResourceKey=vwMaster}}" Width="120" />
                        </Grid>
                        <WF:TSWS06 TabIndex="604" dwVF="{Binding dwVF,ElementName=TV}" ChangeExt="{Binding IsChangedExt,ElementName=TV}" IsUnderEdit="{Binding IsEdit,ElementName=TV}"/>
                    </StackPanel>
                </StackPanel>
                <DataGrid  Grid.Row="1" 
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   IsReadOnly="True"
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"  
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"   Margin="0,0,0,0"
                    >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=VAFKOLL}" Header="{Binding Source={Localization:Translate Word=季节}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=VAFART}" Header="{Binding Source={Localization:Translate Word=品种}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=VAFFARBE}" Header="{Binding Source={Localization:Translate Word=色号}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=VAFBEZ, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=色名}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=VAFARTBEZ, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=说明}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=VAFNEUBEN}" Header="{Binding Source={Localization:Translate Word=创建}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=VAFNEUDAT}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=VAFAENDBEN}" Header="{Binding Source={Localization:Translate Word=更改}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=VAFAENDDAT}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                    </DataGrid.Columns>
                </DataGrid  >
            </Grid>
        </Border> 
    </Grid>
</T:ViewBase>
